<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>星调查问卷系统</title>

<!-- BOOTSTRAP STYLES-->
<link href="css/bootstrap.css" rel="stylesheet" />
<!-- FONTAWESOME STYLES-->
<link href="css/font-awesome.css" rel="stylesheet" />
   <!--CUSTOM BASIC STYLES-->
<link href="css/basic.css" rel="stylesheet" />
<!--CUSTOM MAIN STYLES-->
<link href="css/custom.css" rel="stylesheet" />
<!-- GOOGLE FONTS-->
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css' />
</head>
<body>
  	<div>
	  <c:if test="${questions==null}">
				<span>${survey.survey_name}</span>问卷没有问题。
				 <a  href="${pageContext.request.contextPath}/home.do"><i class="fa fa-dashboard "></i>返回首页</a>
	  </c:if>
	</div>
	<c:if test="${questions!=null}">
	<div class="row">
		<div class="col-md-12">
			<form class="form-control" action="${pageContext.request.contextPath}/writeSurvey.do" method="post" >
				<fieldset>
					<div class="form-group">
		       			<legend>问卷名：${survey.survey_name}</legend>
		      		</div>
					<c:if test="${questions!=null }">
						<c:forEach items="${questions}" var="question" varStatus="status">
							<div class="form-group">
								<label>${status.index+1}</label>
								<label>${question.survey_questionName}：</label> 
							</div>
							<c:if test="${question.survey_questionType==1 }">
								<div class="form-group">
									<label>
										<input type="radio" name="survey_questionSingle${question.survey_questionId}" value="${question.survey_questionSingleA}">
										${question.survey_questionSingleA}
									</label> 
								</div>
								<div class="form-group">
									<label>
										<input type="radio" name="survey_questionSingle${question.survey_questionId}" value="${question.survey_questionSingleB}"> 
										${question.survey_questionSingleB}
									</label> 
								</div>
								<div class="form-group">
									<label>
										<input type="radio" name="survey_questionSingle${question.survey_questionId}" value="${question.survey_questionSingleC}">
										${question.survey_questionSingleC}
									</label> 
								</div>
							</c:if>
							<c:if test="${question.survey_questionType==2 }">
								<div class="form-group">
									<textarea class="form-control " cols="20" rows="3" name="survey_questionAnswer${question.survey_questionId}" id="survey_questionAnswer"></textarea>
								</div>
							</c:if>
						</c:forEach>
					</c:if>
				</fieldset>
				<div class="form-group">
					<button type="submit" class="btn btn-default">提交问卷</button>
				</div>
			</form>
		</div>
	</div>
	</c:if>

<!-- SCRIPTS -AT THE BOTOM TO REDUCE THE LOAD TIME-->
<!-- JQUERY SCRIPTS -->
<script src="js/jquery-1.10.2.js"></script>
<!-- BOOTSTRAP SCRIPTS -->
<script src="js/bootstrap.js"></script>
<!-- METISMENU SCRIPTS -->
<script src="js/jquery.metisMenu.js"></script>
   <!-- CUSTOM SCRIPTS -->
<script src="js/custom.js"></script>
</body>
</html>